// dlg.txt

begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(3,3) == 0;
	question = "special";
	text1 = "This network of ravines is called the Promenade. The creations being kept at the Foundry frequently become irritable and unstable if they don't get enough exposure to fresh air and sunlight.";
	text2 = "Thus, when needed, they are brought out here and walked a few laps around the pathways. You think that you have spent some time on this duty. You aren't sure.";
	text3 = "You also think you recall that several pacification pylons have been placed along the pathways here, to slow down any rogues who escape from the Foundry Core.";
	text4 = "If the pylons have malfunctioned, this area might be dangerous until someone can turn them back on.";
	action = SET_SDF 3 3 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(3,4) == 0;
	question = "special";
	text1 = "You walk by a thick stand of trees. Like most of the flora in hostile environments like this, these trees were created by the Shapers. They can grow quickly and provide wood and fuel even up here in the mountains.";
	text2 = "It is an effective testimonial to the power and versatility of Shaper abilities.";
	action = SET_SDF 3 4 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(3,5) == 0;
	question = "special";
	text1 = "You have never been down the road to the east. It looks less heavily used than the others.";
	text2 = "There are two large fyoras standing guard along the road to the east. They look twitchy and unstable. They may react unpredictably when you get close.";
	action = SET_SDF 3 5 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  AUTOPSY CHAMBER";
	text3 = "  Please properly dispose of all unneeded bodily components!";

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  CHOSEN VARIETY REFERENCE";
	text3 = "  Shapers Only.";

begintalknode 7; // fyora book
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The books in this small library list all current Chosen creation types, that is, varieties of creations that have been evaluated and approved by the Shapers of the Foundry.";
	text2 = "None of the books give details on how to make them. Except this one. It describes techniques for creating stronger and more durable fyoras.";
	text3 = "Surprisingly, you find that the dense magical notation of the Shapers is comprehensible to you. Somehow, the words bypass your conscious mind and take root somewhere deeper.";
	text4 = "(Your skill at creating fyoras has increased.)";
	text5 = "You flip through the tome again. You can still understand what it says, at some level. You don't learn anything else, though.";
	code =
		if (gf(4,27) == 0) {
			rs(5);
			sf(4,27,1);
			alter_stat(80,1);
			}
			else {
				rs(3); rs(4);
				}
	break;
	
begintalknode 8;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  PLANT ANALYSIS";
	text3 = "  No Non-Chosen Plant Samples May Be Removed From Foundry!";
	text4 = "  Punishment For Introducing Foreign Flora Is Expulsion!";

begintalknode 9; // barcotts case
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This locker is held shut by several padlocks. They seems flimsy, at first, but then you notice the glyph carefully inscribed on each one.";
	text2 = "Opening this locker is beyond your skills at this point.";
	text3 = "This locker is empty. Someone, probably Barcott, came and emptied it out.";
	action = DEP_ON_SDF 1 12 1;



begintalknode 10;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  Foundry Core East";

begintalknode 11;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  Foundry Core - West";
	text3 = "  Testing Halls - East";


begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "A soldier is sitting on this bench, wrapped up in blankets and trying to stay warm. He occasionally pokes at the fire with a stick.";
	text2 = "When you try to talk to him, he mutters irritably at you. After several questions and several incomprehensible grumbles in response, he points across the fire. _Talk to him. I'm busy._";
	
	
begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There are several thahds hiding in this ruined workshop. They don't appear to be rogue. They also aren't friendly. They gnaw on the leaves and smaller branches of some of the plants stored here, and they watch you nervously.";
	text2 = "This thahd doesn't seem able to talk. It says, through a mouth full of partially masticated leaves, _Krog. Krog._ It points at the thahd in the center of the room.";
	
begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "When you get close to this fyora, it lets out a long, angry hiss. You back away.";
	
begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "As you get close to the sentinel fyora, it lets out a long, angry hiss. Its head swings jerkily from side to side.";
	text2 = "It takes a moment to figure out what is irritating it. It is the humming sound, coming from the crystal Sage Fefer gave you. It seems to aggravate the fyoras, which were already borderline out of control to begin with.";
	text3 = "You try to back away, but it is too late ...";
	code =
		set_attitude(36,10);
		set_attitude(37,10);
	break;

begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You check the scrying stone to see if the Presence is nearby. The stone is completely dark.";
	text2 = "It must not currently be in the Promenade.";
	
begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Mehken lets out a long, low sigh. You ask her what is wrong.";
	text2 = "_Nothing important. Is the Promenade. So many times walking around. So many hours pulling creations on a rope. In the snow._";
	text3 = "_Am tired of this place. If I knew about the Promenade, would never have come here._";
	text4 = "You ask her what she meant by that, but she is silent again.";
	
begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Private Savage";
	text1 = "There is a human soldier sitting near this fire, trying to keep the cold at bay. He occasionally takes a swig of hot tea and pulls a chunk from a loaf of bread. He is careful to brush the snow off before he eats it.";
	text2 = "He looks closely at you. _You look familiar ... Aren't you one of the ..._ He shakes his head. _Never mind. Hope you're here to help with the rogues. I'm Private Savage._";
	text5 = "Private Savage stares into the fire, sipping tea and contemplating his near-total misery. Occasionally, his partner on the other side of the fire mutters angrily.";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = gf(3,6) < 2;
	question = "What is the situation here?";
	text1 = "_Rogues. Whatever's been making all the creations go crazy, it hit here hard. Some creations were being walked around the loop. They all went mad._";
	text2 = "_Worse, the pacification pylons broke down at the same time. Tried to get someone to come out and fix them, but no luck so far._";
	text3 = "_I hear things are better now in other parts of the Foundry. We're still having our problems._";
	code =
		if (gf(2,3) < 4)
			rs(3);
	break;

begintalknode 32;
	state = 30;
	nextstate = 33;
	condition = 1;
	question = "Tell me about this area.";
	text1 = "_This is the Promenade. Creations get brought here and walked in a loop. As I suspect you know._";
	text2 = "_West is Minallah. The road up there ..._ He points to the northeast. _It goes to the Testing Halls in one direction and the Foundry Core in another._";

begintalknode 33;
	state = 30;
	nextstate = -1;
	condition = gf(3,6) >= 2;
	question = "What is the situation here?";
	text1 = "_A lot better now. We need to keep rogues out of Minallah. All of the rogues are too busy staring at the pacification pylons and being happy._";
	text2 = "_That'll help keep things calm until a Shaper comes out and fixes everything._";

begintalknode 34;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Why don't you go out and hunt the rogues?";
	text1 = "The two privates simultaneously make identical derisive snorts. _We're not Shapers. We don't do Shaper work. Not unless Shapers say so._";
	text2 = "_Our orders are to watch the path to Minallah and keep wandering rogues away. That's what we do._";

begintalknode 35;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Tell me about the pylons.";
	text1 = "_They let out a hum. A happy hum, that calms down rogues. Won't keep the rogue from killing you if you bother it too much, but you can get a lot closer to it without it attacking._";
	text2 = "_That is, that's how it works when the pylon is running. Which isn't always._";

begintalknode 36;
	state = 31;
	nextstate = 32;
	condition = 1;
	question = "Any way I can help?";
	text1 = "_Well, if you knew how to activate the pacification pylons, it would be a big help. We wouldn't round up the rogues, but it'd make it a lot easier for the tenders to do it._";
	text2 = "_If you could activate all three pylons, it'd be a big help._ The other private emits a grunt of sincere approval to this plan.";
	code = 
		set_flag(3,6,1);
		toggle_quest(37,1);
	break;
begintalknode 37;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "How do I turn on a pylon?";
	text1 = "_Look for the pylon. Follow the conduit by it to the other end. There should be a power spiral there. Figure out how to hook it back up. Then do that._";
	text2 = "_One nice thing about that. The rogues around that pylon will become a lot easier to pass. As long as you don't get too close._";

begintalknode 38;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "What are the Testing Halls?";
	text1 = "_No idea. Some Shaper thing. Outsiders like us are discouraged from going there. I, personally, am not fond of the occasional flogging, so I keep my distance._";

begintalknode 39;
	state = 33;
	nextstate = -1;
	condition = 1;
	question = "What is in the Foundry Core?";
	text1 = "_That's where all the creations who get brought here are stored and tested. Normally a much better place to work. A lot warmer._";
	text2 = "_Lately, I hear it's lousy with rogues._";
	code =
		if (gf(2,3) >= 4)
			rs(2);
	break;
		
begintalknode 40;
	state = 30;
	nextstate = -1;
	condition = gf(1,8) == 1 && gf(3,2) < 3;
	question = "I heard that there are some special rogues out here. Surrounded with this shroud of energy.";
	text1 = "The other soldier mutters something. He holds up his arm so that his sleeve slides back. You see that his forearm recently received a nasty burn.";
	text2 = "Private Savage says, _You heard right. And we aren't planning to go hunt those things. Not without orders. Look around enough, though, and they'll turn up._";

begintalknode 41;
	state = 32;
	nextstate = -1;
	condition = get_stat(20) >= 4 && gf(4,28) == 0;
	question = "Can I convince you to come out there with me?";
	text1 = "_You're not a Shaper, and we aren't creations. We're staying here. Though, as I said, if you can find a way to sneak to the power sources of the pylons and turn them on, you'll have no problem going through here safely._";
	code =
		sf(4,28,1);
		award_party_xp(50,2);
	break;

begintalknode 42;
	state = 30;
	nextstate = -1;
	condition = gf(3,6) == 1 && gf(3,8) > 0 && gf(3,9) > 0 && gf(3,10) > 0;
	question = "I activated the three pacification pylons.";
	text1 = "The two men nod. _Then you've made our jobs easier. Much easier._";
	text2 = "_Captain Valenta gave us some tools to use to turn on the pylons. If we got the chance, which we didn't. It doesn't feel right keeping them, so I'll pass them to you._";
	text3 = "He gives you a living tool and a pouch of spores.";
	code = 
		set_flag(3,6,2);
		toggle_quest(37,3);
		award_party_xp(200,2);
		reward_give(255);
		reward_give(232);
	break;		

//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = "There is a power spiral here. It seems to have been hooked up to send a constant, low flow of power into the crystal conduits here. For some reason, it isn't working.";
	text3 = "There is a power spiral here. It is still sending a constant, low flow of power into the crystal conduits.";
	action = DEP_ON_SDF 3 8 0;

begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = gf(3,8) == 0;
	question = "Turn on the power.";
	text1 = "You get on your knees on the cold stone, open the base of the power spiral, and try to determine why the power flow stopped.";
	text2 = "You very rapidly reach the limits of your knowledge of mechanics. All of the bits of wire and delicate metal parts defeat your comprehension. You get back up.";
	text3 = "You pull out a few sections of wire and reconnect them. You push the gears with your finger to make sure they aren't stuck. You deactivate the spiral and turn it back on. And, just like that, it starts working again.";
	text4 = "As the power flow resumes, you ponder how odd this is. The spiral wasn't broken or obviously sabotaged. Something just made it stop working for a time.";
	action = END_TALK;
	code =
		if (get_stat(21) < 4) {
			rs(3); rs(4);
			}
			else {
				rs(2);
				sf(3,8,1);
				award_party_xp(50,2);
				}
	break;
	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "Leave it alone.";
	text1 = "Power spirals can explode if not treated properly. You leave it alone.";
	action = END_TALK;

begintalknode 60;
	state = -1;
	nextstate = 60;
	condition = 1;
	question = "Name";
	text1 = "There is a power spiral here. It seems to have been hooked up to send a constant, low flow of power into the crystal conduits here. For some reason, it isn't working.";
	text3 = "There is a power spiral here. It is still sending a constant, low flow of power into the crystal conduits.";
	action = DEP_ON_SDF 3 9 0;

begintalknode 61;
	state = 60;
	nextstate = -1;
	condition = gf(3,9) == 0;
	question = "Turn on the power.";
	text1 = "You get on your knees on the cold stone, open the base of the power spiral, and try to determine why the power flow stopped.";
	text2 = "You very rapidly reach the limits of your knowledge of mechanics. All of the bits of wire and delicate metal parts defeat your comprehension. You get back up.";
	text3 = "You pull out a few sections of wire and reconnect them. You push the gears with your finger to make sure they aren't stuck. You deactivate the spiral and turn it back on. And, just like that, it starts working again.";
	text4 = "As the power flow resumes, you ponder how odd this is. The spiral wasn't broken or obviously sabotaged. Something just made it stop working for a time.";
	action = END_TALK;
	code =
		if (get_stat(21) < 4) {
			rs(3); rs(4);
			}
			else {
				rs(2);
				sf(3,9,1);
				award_party_xp(50,2);
				}
	break;
	
begintalknode 62;
	state = 60;
	nextstate = -1;
	condition = 1;
	question = "Leave it alone.";
	text1 = "Power spirals can explode if not treated properly. You leave it alone.";
	action = END_TALK;
	
	
begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "There is a power spiral here. It seems to have been hooked up to send a constant, low flow of power into the crystal conduits here. For some reason, it isn't working.";
	text3 = "There is a power spiral here. It is still sending a constant, low flow of power into the crystal conduits.";
	action = DEP_ON_SDF 3 10 0;

begintalknode 71;
	state = 70;
	nextstate = -1;
	condition = gf(3,10) == 0;
	question = "Turn on the power.";
	text1 = "You get on your knees on the cold stone, open the base of the power spiral, and try to determine why the power flow stopped.";
	text2 = "You very rapidly reach the limits of your knowledge of mechanics. All of the bits of wire and delicate metal parts defeat your comprehension. You get back up.";
	text3 = "You pull out a few sections of wire and reconnect them. You push the gears with your finger to make sure they aren't stuck. You deactivate the spiral and turn it back on. And, just like that, it starts working again.";
	text4 = "As the power flow resumes, you ponder how odd this is. The spiral wasn't broken or obviously sabotaged. Something just made it stop working for a time.";
	action = END_TALK;
	code =
		if (get_stat(21) < 4) {
			rs(3); rs(4);
			}
			else {
				rs(2);
				sf(3,10,1);
				award_party_xp(50,2);
				}
	break;
	
begintalknode 72;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "Leave it alone.";
	text1 = "Power spirals can explode if not treated properly. You leave it alone.";
	action = END_TALK;
	
//

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = "There are several thahds hiding in this ruined workshop. They don't appear to be rogue. They also aren't friendly. They gnaw on the leaves and smaller branches of some of the plants stored here, and they watch you nervously.";
	text2 = "The thahd in the center of the room seems calmer than the others. When it looks at you, it also seems much more intelligent than your average thahd.";
	text3 = "For example, it can talk, something very few thahds can do. It says, _I Krog. No rogue. I no rogue! We hide. You go!_";
	text5 = "Krog and his fellow thahds are still hiding in these ruins. They seem to be aware that, if the Shapers find them here, they are doomed. They also have no idea what to do about it.";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = 91;
	condition = 1;
	question = "Where are you from, Krog?";
	text1 = "_I made. I brought. Shapers poke Krog. Shapers talk. They ..._ He struggles for a word. _They watch. They say where Krog go._";

begintalknode 92;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "Who created you?";
	text1 = "_Shaper. Shaper far away. Krog brought here. Krog walk long way._";

begintalknode 93;
	state = 91;
	nextstate = 92;
	condition = 1;
	question = "What did they say about Krog? I mean, about you?";
	text1 = "_They say Krog ..._ He repeats the unfamiliar word. _Unsuitable. That is word that say. They say Krog die._";
	text2 = "That makes sense. Creations brought here and deemed too intelligent or dangerous are routinely disposed of.";
	text3 = "_Then all go mad. Shapers run. Serviles run. Krog sees chance. Krog runs. Other thahds trust Krog. Follow._";

begintalknode 94;
	state = 92;
	nextstate = -1;
	condition = 1;
	question = "The thahds follow you?";
	text1 = "_Trust Krog. Stay near Krog. Defend Krog._";
	text2 = "A thahd smart enough to shake the loyalty of other creations? Krog is lucky they didn't incinerate him instantly.";
	text3 = "_Now Krog hides. Not know where to go._";

begintalknode 95;
	state = 90;
	nextstate = 93;
	condition = 1;
	question = "This isn't your workshop. You need to leave.";
	text1 = "Krog bares his teeth slightly. _Krog want to live. Others will live. Krog ... protects. No go. Here we hide._ Krog is smarter than other thahds, but he is no genius.";
	text2 = "_Krog not trust Shapers. Not do what they say. Krog hides. With other thahds._";
	
begintalknode 96;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "I'm going now.";
	text1 = "Krog nods. It looks at the other thahds. Krog seems genuinely worried about them. _Krog hide. No hurt Krog. Please._";
	action = END_TALK;
	
begintalknode 97;
	state = 93;
	nextstate = -1;
	condition = get_stat(20) >= 4;
	question = "I will let you go. If you stay here, they will find and destroy you. Your only chance is to run.";
	text1 = "You say your words with all of the calm authority you can manage. You manage to convince this simple and untrusting creature.";
	text2 = "Without another word to you, Krog grunts at the other thahds. They immediately drop their food and rise to their feet. They walk out of the workshop in single file, not looking at you as they pass.";
	text3 = "And several more rebellious creations are loosed upon the world. The Shapers would be angry if they knew. At least the workshop is empty now.";
	action = END_TALK;
	code =
		erase_char(1005);
		sf(3,1,1);
		inc_flag(100,0,-3);
	break;
	
begintalknode 98;
	state = 93;
	nextstate = -1;
	condition = get_stat(20) < 4;
	question = "I will let you go. If you stay here, they will find and destroy you.";	
	text1 = "You say your words with all of the calm authority you can manage. It is not enough to convince this dense and paranoid creature. It bares its teeth at you.";
	text2 = "_Krog hide. Hide here. You go, or Krog fight._";
	
begintalknode 99;
	state = 93;
	nextstate = -1;
	condition = 1;
	question = "You are a rebel. You must die.";
	text1 = "Krog snarls. _Rebel? No know rebel. You bad. Krog kill you. Krog hides!_";
	text2 = "Krog lets out a long low growl. All of the thahds respond immediately.";	
	action = END_TALK;
	code =
		inc_flag(100,0,3);
		set_attitude(1005,10);
	break;
	
begintalknode 100;
	state = 93;
	nextstate = -1;
	condition = 1;
	question = "I'm going now.";
	text1 = "Krog nods. It looks at the other thahds. Krog seems genuinely worried about them. _Krog hide. You hurt Krog, you fight. You go now. Please._";
	action = END_TALK;
	
	
begintalknode 290; // 
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "Alas, your actions have infuriated the locals. Shaper Rawal's instructions to the city guards if you turn unpredictable or dangerous are clear. They hunt you down.";
	text2 = "You have some success evading them for a while. Then Shaper Rawal decides to get involved.";
	text3 = "A few days later, while you are hiding in an icy crevasse, you feel a numb sensation in your chest. Then it becomes a sharp pain. Then you collapse and die.";
	text4 = "If you had lasted longer, you might have discovered a way to free yourself from the powerful bonds Shaper Rawal placed on you. Sadly, it was not to be.";
	code =
		erase_char(1000);
	break;		